<!--
/**************************************************
* @ stockanalysemonthreport.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/12, Simonyi Peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<%
	SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMM");
	String date = sdf.format(new java.util.Date(System.currentTimeMillis()));
	String year = date.substring(0,4);
	String month = date.substring(4);
%>

<html>
<head>
<title>采购分析月报表</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<link href="css/caigouxitong.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<%
String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");
if(msg != null){
%>

<script language='javascript'>
	alert("<%=msg%>");
</script>
<%
}
%>

<script language='javascript'>
	var counter;
	function process(val){

		if(val == '1'){
			if(document.all.balanceyear.value == null || document.all.balanceyear.value == ""){
				alert("请选择结算年份");
				return false;
			}
			if(document.all.balancemonth.value == null || document.all.balancemonth.value == ""){
				alert("请选择结算月份");
				return false;
			}
			document.all.begindate.value=document.all.balanceyear.value;
			document.all.enddate.value=document.all.balancemonth.value;
			document.all.querytype.value='1';
		}
		if(val == '2'){
			document.all.begindate.value=document.all.balancestartdate.value;
			document.all.enddate.value=document.all.balanceenddate.value;
			document.all.querytype.value='2';			
		}
		orderreivewform.action = "<%=response.encodeURL(request.getContextPath() + "/GSStockAnalyseMonthReport") %>";
		orderreivewform.submit();
		

	}
	
</script>
</head>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" class="mtxt_black">采购分析月报表</td>
          <td height="30" align="left"><font color="red">(注意：如生成报表有问题，请用Office2000以上版本，或尽量选择查询条件。)</font></td>	
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<form name="orderreivewform" method="post" >
<input type='hidden' name='begindate' value=''>
<input type='hidden' name='enddate' value=''>
<input type='hidden' name='querytype' value=''>

	<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table  cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>选择结算月份</TD>
					<TD align=left class="bg_row_odd">
						<select name="balanceyear" >
							<option value=''>请选择&nbsp;</option>
							<%
								String[][] years = GSBaseManager.getBalanceYears();
								for(int i=0;i<years.length;i++){
							%>						
									<option value='<%=years[i][0]%>' <%if(year.equals(years[i][0])) out.print("selected");%>><%=years[i][1]%></option>
							<%
								}
							%>
						</select>
						<select name="balancemonth" >
							<option value=''>请选择&nbsp;</option>
							<%
								String[][] months = GSBaseManager.getBalanceMonths();
								for(int i=0;i<months.length;i++){
							%>						
									<option value='<%=months[i][0]%>' <%if(month.equals(months[i][0])) out.print("selected");%>><%=months[i][1]%></option>
							<%
								}
							%>
						</select>

					</TD>
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(1)'>
					</td>
				</tr>
				<tr>
				<%
				String[] balanced = GSBaseManager.getBalanceDate();				
				%>
					<TD class="bg_column" align=center>选择时间段</TD>					
					<TD align=left class="bg_row_odd">
						<input type="text" onfocus='setday(this)' name="balancestartdate" size='10' value="<%=balanced[0]%>">
						~
						<input type="text" onfocus='setday(this)' name="balanceenddate" size='10' value="<%=balanced[1]%>">
					</TD>										
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(2)'>
					</td>
				</TR>
			</table>
		</td>
	</tr>
</table>
</form>
    <!--p align="center">  
		<input type="button" class='kuang' width="58" height="24" value="查询" onclick="process('Q')"/>&nbsp;
    </p-->

</body>
</html>